<template>
    <ViewBox>
        <dheader :title="navlist.find(v=>(v.path===pathname)).title"></dheader>
        <router-view id="home-view"></router-view>
        <tabbar :navlist="navlist"></tabbar>
    </ViewBox>
</template>

<script>
import { ViewBox } from 'vux'
import tabbar from "@/components/footer/tabbar";
import dheader from "@/components/header/header-d";
export default {
    name : 'home',
    data() {
        return {
            navlist:[
                {
                    path: '/index',
                    title: '首页',
                    text: '首页',
                    iconClass:'icon-icon-f1'
                },
                {
                    path: '/search',
                    title: '搜索',
                    text: '搜索',
                    iconClass:'icon-cx'
                },
                {
                    path: '/my',
                    title: '我的',
                    text: '我的',
                    iconClass:'icon-wo'
                }
            ],
            pathname: this.$route.path
        }
    },
    components: {
        ViewBox, tabbar, dheader
    },
    created() {

    },
    mounted() {
    },
    distoryed() {

    },
    methods: {

    },
    watch: {
        '$route'(to,from){
            this.pathname = to.path
        }
    }
}
</script>

<style lang="less">
    #header-d .vux-header{position: fixed;top: 0;width: 100%;}
    #home-view{width: 100%;height: 100%;padding: 46px 0 4px;box-sizing: border-box;overflow:auto;}
    #home-view::-webkit-scrollbar{width:0px;}
    #footer{position: fixed;bottom: 0;}
</style>
